*****************************************************************************
* Title: Public Support for Citizens’ Assemblies Selected through Sortition *
* Author: Pilet, Bol, Vittori, Paulis                                       *
* Software: Stata 17/SE                                                     *
* Packages: outreg2                                                         *
*****************************************************************************

* 1. Loading data
******************

set more off

*cd "/Users/emilienpaulis/Downloads" // Specify your own local file here
cd "/Users/damienbol/Dropbox/EPIS Sortition/"

import excel clean_jb.xlsx, sheet("Feuil1") firstrow clear

drop QS1 QS2 QS3 QS4 QS5 QS6 QS7 QS8 QS9 QS10 QS11 QS12 QS13 QS14 QS15

save data.dta, replace

* 2. Recoding variables
***********************

use data.dta, clear

* Country

rename Country country

* Personal support for policies

gen support_europe_personal=Q13A if Q13A<6
replace support_europe_personal=5-support_europe_personal

gen support_redistribution_personal=Q13B if Q13B<6
replace support_redistribution_personal=5-support_redistribution_personal

gen support_immigration_personal=Q13C if Q13C<6
replace support_immigration_personal=support_immigration_personal-1

* Real support for policies in population

gen support_europe_real=.
replace support_europe_real=0.60 if country==1
replace support_europe_real=0.75 if country==2 | country==3
replace support_europe_real=0.84 if country==4
replace support_europe_real=0.66 if country==5
replace support_europe_real=0.64 if country==6
replace support_europe_real=0.76 if country==7
replace support_europe_real=0.54 if country==8
replace support_europe_real=0.43 if country==9
replace support_europe_real=0.92 if country==10
replace support_europe_real=0.78 if country==11
replace support_europe_real=0.78 if country==13
replace support_europe_real=0.74 if country==14
replace support_europe_real=0.73 if country==15
replace support_europe_real=0.60 if country==16

gen support_redistribution_real=.
replace support_redistribution_real=0.603 if country==1
replace support_redistribution_real=0.662 if country==2 | country==3
replace support_redistribution_real=0.598 if country==4
replace support_redistribution_real=0.69 if country==5
replace support_redistribution_real=0.55 if country==6
replace support_redistribution_real=0.462 if country==7
replace support_redistribution_real=0.605 if country==8
replace support_redistribution_real=0.518 if country==9
replace support_redistribution_real=0.56 if country==10
replace support_redistribution_real=0.637 if country==11
replace support_redistribution_real=0.681 if country==12
replace support_redistribution_real=0.533 if country==13
replace support_redistribution_real=0.621 if country==14
replace support_redistribution_real=0.64 if country==15
replace support_redistribution_real=0.36 if country==16

gen support_immigration_real=.
replace support_immigration_real=0.47 if country==1
replace support_immigration_real=0.50 if country==2 | country==3
replace support_immigration_real=0.43 if country==4
replace support_immigration_real=0.49 if country==5
replace support_immigration_real=0.45 if country==6
replace support_immigration_real=0.52 if country==7
replace support_immigration_real=0.29 if country==8
replace support_immigration_real=0.37 if country==9
replace support_immigration_real=0.72 if country==10
replace support_immigration_real=0.55 if country==11
replace support_immigration_real=0.51 if country==12
replace support_immigration_real=0.60 if country==13
replace support_immigration_real=0.60 if country==14
replace support_immigration_real=0.69 if country==15
replace support_immigration_real=0.69 if country==16

* Perceived support for policies in population

replace Q14C_1=. if Q14C_1>100
replace Q14T_1=. if Q14T_1>100

gen support_europe_perceived=Q14C_1
replace support_europe_perceived=Q14T_1 if support_europe_perceived==.
replace support_europe_perceived=support_europe_perceived/100 if support_europe_perceived>1

replace Q15_C1="" if Q15_C1=="8υ"
replace Q15_C1="90" if Q15_C1=="90%"
replace Q15_C1="0.70" if Q15_C1=="0,70"

destring Q15_C1, gen(Q15C_1)
rename Q15_1 Q15T_1

replace Q15C_1=. if Q15C_1>100
replace Q15T_1=. if Q15T_1>100

gen support_immigration_perceived=Q15C_1
replace support_immigration_perceived=Q15T_1 if support_immigration_perceived==.
replace support_immigration_perceived=support_immigration_perceived/100 if support_immigration_perceived>1
replace support_immigration_perceived=1-support_immigration_perceived

replace Q16C_1=. if Q16C_1>100
replace Q16T_1=. if Q16T_1>100

gen support_redistribution_perceived=Q16C_1
replace support_redistribution_perceived=Q16T_1 if support_redistribution_perceived==.
replace support_redistribution_perceived=support_redistribution_perceived/100 if support_redistribution_perceived>1

* Treatment

gen treatment=0 if Q14C!=.
replace treatment=1 if Q14T!=.

* Being in the majority (real)

gen majority_europe_real=support_europe_real-0.50 if support_europe_person>2
replace majority_europe_real=-(support_europe_real-0.50) if support_europe_personal<2
replace majority_europe_real=0 if support_europe_personal==2

gen majority_redistribution_real=support_redistribution_real-0.50 if support_redistribution_personal>2
replace majority_redistribution_real=-(support_redistribution_real-0.50) if support_redistribution_personal<2
replace majority_redistribution_real=0 if support_redistribution_personal==2

gen majority_immigration_real=support_immigration_real-0.50 if support_immigration_personal>2
replace majority_immigration_real=-(support_immigration_real-0.50) if support_immigration_personal<2
replace majority_immigration_real=0 if support_immigration_personal==2

* Being in the majority (real) (but only those who have a strong position)

gen majority_europe_real2=support_europe_real-0.50 if support_europe_person>1
replace majority_europe_real2=-(support_europe_real-0.50) if support_europe_personal<3
replace majority_europe_real2=0 if support_europe_personal==2 | support_europe_personal==1 | support_europe_personal==3

gen majority_redistribution_real2=support_redistribution_real-0.50 if support_redistribution_personal>2
replace majority_redistribution_real2=-(support_redistribution_real-0.50) if support_redistribution_personal<2
replace majority_redistribution_real2=0 if support_redistribution_personal==2 | support_redistribution_personal==1 | support_redistribution_personal==3

gen majority_immigration_real2=support_immigration_real-0.50 if support_immigration_personal>2
replace majority_immigration_real2=-(support_immigration_real-0.50) if support_immigration_personal<2
replace majority_immigration_real2=0 if support_immigration_personal==2 | support_immigration_personal==1 | support_immigration_personal==3

* Being in the majority (perceived)

gen majority_europe_perceived=support_europe_perceived-0.50 if support_europe_person>2
replace majority_europe_perceived=-(support_europe_perceived-0.50) if support_europe_personal<2
replace majority_europe_perceived=0 if support_europe_personal==2

gen majority_redistribution_perc=support_redistribution_perceived-0.50 if support_redistribution_personal>2
replace majority_redistribution_perc=-(support_redistribution_perceived-0.50) if support_redistribution_personal<2
replace majority_redistribution_perc=0 if support_redistribution_personal==2

gen majority_immigration_perc=support_immigration_perc-0.50 if support_immigration_personal>2
replace majority_immigration_perc=-(support_immigration_perc-0.50) if support_immigration_personal<2
replace majority_immigration_perc=0 if support_immigration_personal==2

* Support for sortition

replace Q17C_1=. if Q17C_1>11
replace Q17C_2=. if Q17C_2>11
replace Q17C_3=. if Q17C_3>11

replace Q17T_1=. if Q17T_1>11
replace Q17T_2=. if Q17T_2>11
replace Q17T_3=. if Q17T_3>11

gen support_sortition_europe=Q17C_1
replace support_sortition_europe=Q17T_1 if support_sortition_europe==.
replace support_sortition_europe=support_sortition_europe-1

gen support_sortition_redistribution=Q17C_3
replace support_sortition_redistribution=Q17T_3 if support_sortition_redistribution==.
replace support_sortition_redistribution=support_sortition_redistribution-1

gen support_sortition_immigration=Q17C_2
replace support_sortition_immigration=Q17T_2 if support_sortition_immigration==.
replace support_sortition_immigration=support_sortition_immigration-1

replace Q17B_1=. if Q17B_1>11

gen support_sortition_generic=Q17B_1
replace support_sortition_generic=Q17B_1 if support_sortition_generic==.
replace support_sortition_generic=support_sortition_generic-1

* Age

rename Age age

* Gender

gen gender=0 if Gender=="Male"
replace gender=1 if Gender=="Female"

* Education

encode Education, generate (Education1)
gen education=.
replace education=2 if Education1==1
replace education=2 if Education1==2
replace education=2 if Education1==3
replace education=2 if Education1==9
replace education=2 if Education1==10
replace education=2 if Education1==11
replace education=2 if Education1==21
replace education=2 if Education1==23
replace education=2 if Education1==24
replace education=2 if Education1==25
replace education=2 if Education1==26
replace education=2 if Education1==27
replace education=2 if Education1==28
replace education=1 if Education1==5
replace education=1 if Education1==8
replace education=1 if Education1==14
replace education=1 if Education1==15
replace education=1 if Education1==16
replace education=1 if Education1==17
replace education=1 if Education1==18
replace education=1 if Education1==19
replace education=1 if Education1==20
replace education=1 if Education1==22
replace education=1 if Education1==29
replace education=1 if Education1==30
replace education=1 if Education1==31
replace education=0 if Education1==13
replace education=0 if Education1==7
replace education=0 if Education1==6
replace education=0 if Education1==4
drop if Education1==12

* Urbanisation

replace Q10=. if Q10>5
gen urbanisation=.
replace urbanisation=5 if Q10==1
replace urbanisation=4 if Q10==2
replace urbanisation=3 if Q10==3
replace urbanisation=2 if Q10==4
replace urbanisation=1 if Q10==5

* Income

replace Q11=. if Q11>4
gen income=.
replace income=4 if Q11==1
replace income=3 if Q11==2
replace income=2 if Q11==3
replace income=1 if Q11==4

* Left Right Placement

replace Q1=. if Q1>11
gen lr_placement=Q1-1

* Political interest

replace Q2=. if Q2>4
gen pol_interest=.
replace pol_interest=4 if Q2==1
replace pol_interest=3 if Q2==2
replace pol_interest=2 if Q2==3
replace pol_interest=1 if Q2==4

* Turnout

replace Q3=. if Q3>2
gen voting=Q3
replace voting=0 if Q3==2

* Vote for incumbent

gen vote_incumbent=0
replace vote_incumbent=1 if Q4==2 & country==1 // Austria
replace vote_incumbent=1 if Q4==4 & country==1
replace vote_incumbent=1 if Q4==3 & country==2 // Belgium (FR)
replace vote_incumbent=1 if Q4==4 & country==2
replace vote_incumbent=1 if Q4==10 & country==2
replace vote_incumbent=1 if Q4==1 & country==3 // Belgium (NL)
replace vote_incumbent=1 if Q4==8 & country==3
replace vote_incumbent=1 if Q4==9 & country==3
replace vote_incumbent=1 if Q4==1 & country==4 // Denmark
replace vote_incumbent=1 if Q4==1 & country==5 // Finland
replace vote_incumbent=1 if Q4==4 & country==5 
replace vote_incumbent=1 if Q4==5 & country==5 
replace vote_incumbent=1 if Q4==6 & country==5
replace vote_incumbent=1 if Q4==1 & country==6 // France
replace vote_incumbent=1 if Q4==5 & country==6
replace vote_incumbent=1 if Q4==1 & country==7 // Germany
replace vote_incumbent=1 if Q4==2 & country==7
replace vote_incumbent=1 if Q4==7 & country==7
replace vote_incumbent=1 if Q4==2 & country==8 // Greece
replace vote_incumbent=1 if Q4==5 & country==9 // Italy
replace vote_incumbent=1 if Q4==6 & country==9
replace vote_incumbent=1 if Q4==1 & country==10 // Ireland
replace vote_incumbent=1 if Q4==1 & country==11 // Netherlands
replace vote_incumbent=1 if Q4==5 & country==11
replace vote_incumbent=1 if Q4==6 & country==11
replace vote_incumbent=1 if Q4==7 & country==11
replace vote_incumbent=1 if Q4==2 & country==12 // Norway
replace vote_incumbent=1 if Q4==3 & country==12
replace vote_incumbent=1 if Q4==7 & country==12
replace vote_incumbent=1 if Q4==1 & country==13 // Portugal
replace vote_incumbent=1 if Q4==2 & country==14 // Spain
replace vote_incumbent=1 if Q4==3 & country==14
replace vote_incumbent=1 if Q4==1 & country==15 // Sweden
replace vote_incumbent=1 if Q4==4 & country==15
replace vote_incumbent=1 if Q4==1 & country==16 // UK

* Satisfaction with democracy

replace Q5=. if Q5>11
gen swd=Q5-1

* Poltical efficacy

replace Q8C=. if Q8C>4
gen pol_efficacy=Q8C


* Trust in politicans

replace Q6A=. if Q6A>4
gen trust1=Q6A

replace Q6B=. if Q6B>4
gen trust2=Q6B
replace trust2=4 if Q6B==1
replace trust2=3 if Q6B==2
replace trust2=2 if Q6B==3
replace trust2=1 if Q6B==4

gen anti_elitism=(trust1+trust2)/2

alpha  trust1 trust2


* Occurences of citizens' assemblies in the country 

gen occurence=.
replace occurence=15 if country==1 // Austria
replace occurence=4 if country==2 // Belgium (FR)
replace occurence=4 if country==3 // Belgium (NL)
replace occurence=12 if country==4 // Denmark
replace occurence=1 if country==5 // Finland
replace occurence=20 if country==6 // France
replace occurence=13 if country==7 // Germany
replace occurence=0 if country==8 // Greece
replace occurence=7 if country==9 // Italy
replace occurence=3 if country==10 // Ireland
replace occurence=3 if country==11 // Netherlands
replace occurence=1 if country==12 // Norway
replace occurence=2 if country==13 // Portugal
replace occurence=1 if country==14 // Spain
replace occurence=1 if country==15 // Sweden
replace occurence=17 if country==16 // UK


* 3. Analysis in the text
*************************

* Figure 1: descriptive statistics of dependentvariable

sum support_sortition*

hist support_sortition_generic, percent scheme(s2mono) graphregion(color(white)) xtitle("Support for citizens' assemblies (general)") ytitle("Percentage") xlabel(0(1)10) ylabel(0(5)20) caption("N=14,243") barwidth(1)
graph save hist1.gph, replace

lab define country 1"AU" 2"BE(FR)" 3"BE(FL)" 4"DK" 5"FI" 6"FR" 7"DE" 8"EL" 9"IT" 10"IE" 11"NL" 12"NO" 13"PT" 14"ES" 15"SE" 16"UK", replace
lab values country country

graph box support_sortition_generic, over(country, label(alt labs(small))) scheme(s2mono) graphregion(color(white)) ytitle("Support for citizens' assemblies (general)")
graph save box1.gph, replace


graph combine hist1.gph box1.gph, row(1) graphregion(color(white)) 
graph export figure1.png, replace


* Table 1: regressions with generic support

reg support_sortition_generic gender education age income urbanisation i.country
outreg2 using Table1.doc, se dec(2) alpha(0.01, 0.05, 0.10) ctitle("Generic support") replace

reg support_sortition_generic gender education age income urbanisation pol_efficacy pol_interest swd lr_placement anti_elitism voting vote_incumbent i.country
outreg2 using Table1.doc, se dec(2) alpha(0.01, 0.05, 0.10) ctitle("Generic support") append

* Table 2: treatment effects

reg support_sortition_europe c.majority_europe_real##c.treatment i.country
outreg2 using treatment.doc, se dec(2) alpha(0.01, 0.05, 0.10) ctitle("Europe") replace

reg support_sortition_redistribution c.majority_redistribution_real##c.treatment i.country
outreg2 using treatment.doc, se dec(2) alpha(0.01, 0.05, 0.10) ctitle("Redistribution") append

reg support_sortition_immigration c.majority_immigration_real##c.treatment i.country
outreg2 using treatment.doc, se dec(2) alpha(0.01, 0.05, 0.10) ctitle("Immigration") append

reg support_sortition_europe c.majority_europe_real##c.treatment gender education age income urbanisation i.country
outreg2 using treatment.doc, se dec(2) alpha(0.01, 0.05, 0.10) ctitle("Europe") append

reg support_sortition_redistribution c.majority_redistribution_real##c.treatment gender education age income urbanisation i.country
outreg2 using treatment.doc, se dec(2) alpha(0.01, 0.05, 0.10) ctitle("Redistribution") append

reg support_sortition_immigration c.majority_immigration_real##c.treatment gender education age income urbanisation i.country
outreg2 using treatment.doc, se dec(2) alpha(0.01, 0.05, 0.10) ctitle("Immigration") append

* Figure 2: predicted values

quietly reg support_sortition_europe c.majority_europe_real##c.treatment gender education age income urbanisation i.country

margins, at(majority_europe_real=(-.4(.1).4) treatment=0) atmeans
marginsplot, recastci(rline) ci(lp(dash)) recast(line) ylabel(4(.5)5) ytitle("Predicted support") xtitle("Share of population aligned with resp.") title("Europe (Control)") scheme(s2mono) graphregion(color(white))
graph save europe_control.gph, replace

margins, at(majority_europe_real=(-.4(.1).4) treatment=1) atmeans
marginsplot, recastci(rline) ci(lp(dash)) recast(line) ylabel(4(.5)5) ytitle("Predicted support") xtitle("Share of population aligned with resp.") title("Europe (Treatment)") scheme(s2mono) graphregion(color(white))
graph save europe_treatment.gph, replace

quietly reg support_sortition_immigration c.majority_immigration_real##c.treatment gender education age income urbanisation i.country

margins, at(majority_immigration_real=(-.2(.1).2) treatment=0) atmeans
marginsplot, recastci(rline) ci(lp(dash)) recast(line) ylabel(3.5(1)5.5) ytitle("Predicted support") xtitle("Share of population aligned with resp.") title("Immigration (Control)") scheme(s2mono) graphregion(color(white))
graph save immigration_control.gph, replace

margins, at(majority_immigration_real=(-.2(.1).2) treatment=1) atmeans
marginsplot, recastci(rline) ci(lp(dash)) recast(line) ylabel(3.5(1)5.5) ytitle("Predicted support") xtitle("Share of population aligned with resp.") title("Immigration (Treatment)") scheme(s2mono) graphregion(color(white))
graph save immigration_treatment.gph, replace

quietly reg support_sortition_redistribution c.majority_redistribution_real##c.treatment gender education age income urbanisation i.country

margins, at(majority=(-.2(.1).2) treatment=0) atmeans
marginsplot, recastci(rline) ci(lp(dash)) recast(line) ylabel(2(2)8) ytitle("Predicted support") xtitle("Share of population aligned with resp.") title("Social benefit (Control)") scheme(s2mono) graphregion(color(white))
graph save redistribution_control.gph, replace

margins, at(majority=(-.2(.1).2) treatment=1) atmeans
marginsplot, recastci(rline) ci(lp(dash)) recast(line) ylabel(2(2)8) ytitle("Predicted support") xtitle("Share of population aligned with resp.") title("Social benefit (Treatment)") scheme(s2mono) graphregion(color(white))
graph save redistribution_treatment.gph, replace

graph combine europe_control.gph europe_treatment.gph redistribution_control.gph redistribution_treatment.gph immigration_control.gph immigration_treatment.gph, row(3) ysize(7) graphregion(color(white))
graph export predicted_values.png, replace

* 3. Analysis in the appendix
*****************************

* A1: Histrograms by issue

sum support_sortition*

hist support_sortition_generic, percent scheme(s2mono) graphregion(color(white)) xtitle("Support for citizens' assemblies (general)") ytitle("Percentage") xlabel(0(1)10) ylabel(0(5)20) caption("Mean=4.32, SD=3.05, N=14,243") barwidth(1)
graph save hist1.gph, replace

hist support_sortition_europe, percent scheme(s2mono) graphregion(color(white)) xtitle("Support for citizens' assemblies (Europe)") ytitle("Percentage") xlabel(0(1)10) ylabel(0(5)20)caption("Mean=4.65, SD=3.06, N=13,902") barwidth(1)
graph save hist2.gph, replace

hist support_sortition_redistribution, percent scheme(s2mono) graphregion(color(white)) xtitle("Support for citizens' assemblies (social benefits)") ytitle("Percentage") xlabel(0(1)10) ylabel(0(5)20) caption("Mean=5.18, SD=3.06, N=14,054") barwidth(1)
graph save hist3.gph, replace

hist support_sortition_redistribution, percent scheme(s2mono) graphregion(color(white)) xtitle("Support for citizens' assemblies (immigration)") ytitle("Percentage") xlabel(0(1)10) ylabel(0(5)20) caption("Mean=4.38, SD=3.10, N=14,043") barwidth(1)
graph save hist4.gph, replace

graph combine hist1.gph hist2.gph hist3.gph hist4.gph, row(2) graphregion(color(white))
graph export figure1_appendix.png, replace


* A2: Descriptive in control groups

sum support_sortition_generic* if treatment==0

hist support_sortition_generic if treatment==0, percent scheme(s2mono) graphregion(color(white)) xtitle("Support for citizens' assemblies (general)") ytitle("Percentage") xlabel(0(1)10) ylabel(0(5)20) caption("Mean=4.40, SD=3.02, N=6,631") barwidth(0.1)
graph save hist1.gph, replace

graph box support_sortition_generic, over(country, label(alt labs(small))) scheme(s2mono) graphregion(color(white)) ytitle("Support for citizens' assemblies (general)")
graph save box1.gph, replace

graph combine hist1.gph box1.gph, row(1) graphregion(color(white))
graph export figure2_appendix.png, replace

* A3: Descriptive statistics 

sum gender education age income urbanisation pol_efficacy pol_interest swd lr_placement anti_elitism voting vote_incumbent majority_europe_real majority_redistribution_real majority_immigration_real

* A4: Balance test

logit treatment gender education age income urbanisation pol_efficacy pol_interest swd lr_placement anti_elitism voting vote_incumbent i.country
margins, dydx(*) post
outreg2 using balance.doc, se dec(2) alpha(0.01, 0.05, 0.10) replace

* A5: Manipulation checks

corr support_europe_real support_europe_perceived if treatment==1
corr support_europe_real support_europe_perceived if treatment==0

graph twoway  (scatter support_europe_real support_europe_perceived if treatment==1, msize(tiny) mlc(gs10) jitter(5)  mfc(none) xlabel(0(.2)1) ylabel(.4(.1).9) xtitle("Share in favor of Europe", size(small)) ytitle("Share in favor of Europe", size(small))) (lfit support_europe_real support_europe_perceived if treatment==1, lc(black) lw(thick)), graphregion(color(white)) legend(off) caption("r=0.35") title("Treatment", color(black))
graph save corr_europe_treatment.gph, replace

graph twoway (scatter support_europe_real support_europe_perceived if treatment==0, msize(tiny) mlc(gs10) jitter(5) mfc(none) xlabel(0(.2)1) ylabel(.4(.1).9) xtitle("Share in favor of Europe", size(small)) ytitle("Share in favor Europe", size(small))) (lfit support_europe_real support_europe_perceived if treatment==0, lc(black) lw(thick)), graphregion(color(white)) legend(off) caption("r=0.17") title("Control", color(black))
graph save corr_europe_control.gph, replace

corr support_redistribution_real support_redistribution_perceived if treatment==1
corr support_redistribution_real support_redistribution_perceived if treatment==0

graph twoway  (scatter support_redistribution_real support_redistribution_perceived if treatment==1, msize(tiny) jitter(5) mlc(gs10) mfc(none) xlabel(0(.2)1) ylabel(.3(.1).7) xtitle("Share in favor of social benefits", size(small)) ytitle("Share in favor of social benefits", size(small))) (lfit support_redistribution_real support_redistribution_perceived if treatment==1, lc(black) lw(thick)), graphregion(color(white)) legend(off) caption("r=0.13") title("", color(black))
graph save corr_redistribution_treatment.gph, replace

graph twoway (scatter support_redistribution_real support_redistribution_perceived if treatment==0, msize(tiny) jitter(5) mlc(gs10) mfc(none) xlabel(0(.2)1) ylabel(.3(.1).7) xtitle("Share in favor of social benefits", size(small)) ytitle("Share in favor of social benefits", size(small))) (lfit support_redistribution_real support_redistribution_perceived if treatment==0, lc(black) lw(thick)), graphregion(color(white)) legend(off) caption("r=0.07") title("", color(black))
graph save corr_redistribution_control.gph, replace

corr support_immigration_real support_immigration_perceived if treatment==1
corr support_immigration_real support_immigration_perceived if treatment==0

graph twoway  (scatter support_immigration_real support_immigration_perceived if treatment==1, msize(tiny) jitter(5) mlc(gs10) mfc(none) xlabel(0(.2)1) ylabel(.3(.1).7) xtitle("Share in favor of immigration", size(small)) ytitle("Share in favor of immigration", size(small))) (lfit support_immigration_real support_immigration_perceived if treatment==1, lc(black) lw(thick)), graphregion(color(white)) legend(off) caption("r=0.13") title("", color(black))
graph save corr_immigration_treatment.gph, replace

graph twoway (scatter support_immigration_real support_immigration_perceived if treatment==0, msize(tiny)  jitter(5) mlc(gs10) mfc(none) msymbol(Oh) xlabel(0(.2)1) ylabel(.3(.1).7) xtitle("Share in favor of immigration ", size(small)) ytitle("Share in favor of immigration", size(small))) (lfit support_immigration_real support_immigration_perceived if treatment==0, lc(black) lw(thick)), graphregion(color(white)) legend(off) caption("r=0.21") title("", color(black)) 
graph save corr_immigration_control.gph, replace

graph combine corr_europe_control.gph corr_europe_treatment.gph corr_redistribution_control.gph corr_redistribution_treatment.gph corr_immigration_control.gph corr_immigration_treatment.gph, graphregion(color(white)) row(3) caption("x-axes are perceptions y-axes are real figures from ESS", color(black)) ysize(7)
graph export manipulation.png, replace

* A6: regression with generic support (mlogit + control group + group variables) 

recode support_sortition_generic 0/3 = 0 4/6 = 1 7/10 = 2, generate(support_sortition_generic_cat)

mlogit support_sortition_generic_cat gender education age income urbanisation pol_efficacy pol_interest swd lr_placement anti_elitism voting vote_incumbent i.country, b(1) rrr
outreg2 using Table1_robust.doc, se dec(2) alpha(0.01, 0.05, 0.10) eform ctitle("Generic support") replace

reg support_sortition_generic gender education age income urbanisation pol_efficacy pol_interest swd lr_placement anti_elitism voting vote_incumbent i.country if treatment==0
outreg2 using Table1_robust.doc, se dec(2) alpha(0.01, 0.05, 0.10)  ctitle("Generic support") append


gen enraged=((pol_efficacy-1)/3)+((pol_interest-1)/3)
gen engaged=(swd/10)+((anti_elitism-1)/3)

alpha pol_interest pol_efficacy
alpha swd anti_elitism

reg support_sortition_generic gender education age income urbanisation enraged engaged lr_placement voting vote_incumbent i.country
outreg2 using Table1_robust.doc, se dec(2) alpha(0.01, 0.05, 0.10)  ctitle("Generic support") append

* A7: regression with policy-specific variables

reg support_sortition_europe gender education age income urbanisation pol_efficacy pol_interest swd lr_placement anti_elitism voting vote_incumbent i.country
outreg2 using Table1_policy.doc, se dec(2) alpha(0.01, 0.05, 0.10) ctitle("Europe") replace

reg support_sortition_redistribution gender education age income urbanisation pol_efficacy pol_interest swd lr_placement anti_elitism voting vote_incumbent i.country
outreg2 using Table1_policy.doc, se dec(2) alpha(0.01, 0.05, 0.10) ctitle("Social benefits") append

reg support_sortition_immigration gender education age income urbanisation pol_efficacy pol_interest swd lr_placement anti_elitism voting vote_incumbent i.country
outreg2 using Table1_policy.doc, se dec(2) alpha(0.01, 0.05, 0.10) ctitle("Immigration") append

* A8: regression with generic support (by country) 

reg support_sortition_generic gender education age income urbanisation pol_efficacy pol_interest swd lr_placement anti_elitism voting vote_incumbent if country==1
outreg2 using Table1_country.doc, se dec(2) alpha(0.01, 0.05, 0.10)  ctitle("AT") replace

reg support_sortition_generic gender education age income urbanisation pol_efficacy pol_interest swd lr_placement anti_elitism voting vote_incumbent if country==2
outreg2 using Table1_country.doc, se dec(2) alpha(0.01, 0.05, 0.10) ctitle("BE(FR)") append

reg support_sortition_generic gender education age income urbanisation pol_efficacy pol_interest swd lr_placement anti_elitism voting vote_incumbent if country==3
outreg2 using Table1_country.doc, se dec(2) alpha(0.01, 0.05, 0.10) ctitle("BE(FL)") append

reg support_sortition_generic gender education age income urbanisation pol_efficacy pol_interest swd lr_placement anti_elitism voting vote_incumbent if country==4
outreg2 using Table1_country.doc, se dec(2) alpha(0.01, 0.05, 0.10)  ctitle("DK") append

reg support_sortition_generic gender education age income urbanisation pol_efficacy pol_interest swd lr_placement anti_elitism voting vote_incumbent if country==5
outreg2 using Table1_country.doc, se dec(2) alpha(0.01, 0.05, 0.10) ctitle("FI") append

reg support_sortition_generic gender education age income urbanisation pol_efficacy pol_interest swd lr_placement anti_elitism voting vote_incumbent if country==6
outreg2 using Table1_country.doc, se dec(2) alpha(0.01, 0.05, 0.10) ctitle("FR") append

reg support_sortition_generic gender education age income urbanisation pol_efficacy pol_interest swd lr_placement anti_elitism voting vote_incumbent if country==7
outreg2 using Table1_country.doc, se dec(2) alpha(0.01, 0.05, 0.10) ctitle("DE") append

reg support_sortition_generic gender education age income urbanisation pol_efficacy pol_interest swd lr_placement anti_elitism voting vote_incumbent if country==8
outreg2 using Table1_country.doc, se dec(2) alpha(0.001, 0.01, 0.05)  ctitle("EL") append

reg support_sortition_generic gender education age income urbanisation pol_efficacy pol_interest swd lr_placement anti_elitism voting vote_incumbent if country==9
outreg2 using Table1_country.doc, se dec(2) alpha(0.01, 0.05, 0.10)  ctitle("IT") append

reg support_sortition_generic gender education age income urbanisation pol_efficacy pol_interest swd lr_placement anti_elitism voting vote_incumbent if country==10
outreg2 using Table1_country.doc, se dec(2) alpha(0.001, 0.01, 0.05)  ctitle("IE") append

reg support_sortition_generic gender education age income urbanisation pol_efficacy pol_interest swd lr_placement anti_elitism voting vote_incumbent if country==11
outreg2 using Table1_country.doc, se dec(2) alpha(0.01, 0.05, 0.10) ctitle("NL") append

reg support_sortition_generic gender education age income urbanisation pol_efficacy pol_interest swd lr_placement anti_elitism voting vote_incumbent if country==12
outreg2 using Table1_country.doc, se dec(2) alpha(0.01, 0.05, 0.10)  ctitle("NO") append

reg support_sortition_generic gender education age income urbanisation pol_efficacy pol_interest swd lr_placement anti_elitism voting vote_incumbent if country==13
outreg2 using Table1_country.doc, se dec(2) alpha(0.01, 0.05, 0.10) ctitle("PO") append

reg support_sortition_generic gender education age income urbanisation pol_efficacy pol_interest swd lr_placement anti_elitism voting vote_incumbent if country==14
outreg2 using Table1_country.doc, se dec(2) alpha(0.01, 0.05, 0.10)  ctitle("ES") append

reg support_sortition_generic gender education age income urbanisation pol_efficacy pol_interest swd lr_placement anti_elitism voting vote_incumbent if country==15
outreg2 using Table1_country.doc, se dec(2) alpha(0.01, 0.05, 0.10)  ctitle("SE") append

reg support_sortition_generic gender education age income urbanisation pol_efficacy pol_interest swd lr_placement anti_elitism voting vote_incumbent if country==16
outreg2 using Table1_country.doc, se dec(2) alpha(0.01, 0.05, 0.10)  ctitle("UK") append

* Appendix 9: regression with generic support (and interaction with number of citizens' assemblies in the country)

reg support_sortition_generic occurence gender education age income urbanisation c.gender#c.occurence c.education#c.occurence c.age#c.occurence c.income#c.occurence c.urbanisation#c.occurence, vce(cluster country)
outreg2 using interaction.doc, se dec(2) alpha(0.01, 0.05, 0.10) ctitle("Generic support") replace

reg support_sortition_generic occurence gender education age income urbanisation pol_efficacy pol_interest swd lr_placement anti_elitism voting vote_incumbent c.gender#c.occurence c.education#c.occurence c.age#c.occurence c.income#c.occurence c.urbanisation#c.occurence c.pol_efficacy#c.occurence c.pol_interest#c.occurence c.swd#c.occurence c.lr_placement#c.occurence c.anti_elitism#c.occurence c.voting#c.occurence c.vote_incumbent#c.occurence, vce(cluster country)
outreg2 using interaction.doc, se dec(2) alpha(0.01, 0.05, 0.10) ctitle("Generic support") append


* Appendix 9: Treatment effect by education level

reg support_sortition_europe c.majority_europe_real##c.treatment gender age income urbanisation i.country if education==0
outreg2 using Table1_education.doc, se dec(2) alpha(0.01, 0.05, 0.10)  ctitle("Low education (Europe)") replace

reg support_sortition_europe c.majority_europe_real##c.treatment gender age income urbanisation i.country if education==1
outreg2 using Table1_education.doc, se dec(2) alpha(0.01, 0.05, 0.10)  ctitle("Mid education (Europe)") append

reg support_sortition_europe c.majority_europe_real##c.treatment gender age income urbanisation i.country if education==2
outreg2 using Table1_education.doc, se dec(2) alpha(0.01, 0.05, 0.10)  ctitle("High education (Europe)") append

reg support_sortition_redistribution c.majority_redistribution_real##c.treatment gender age income urbanisation i.country if education==0
outreg2 using Table1_education.doc, se dec(2) alpha(0.01, 0.05, 0.10)  ctitle("Low education (Social benefit) ") append

reg support_sortition_redistribution c.majority_redistribution_real##c.treatment gender age income urbanisation i.country if education==1
outreg2 using Table1_education.doc, se dec(2) alpha(0.01, 0.05, 0.10)  ctitle("Mid education (Social benefit)") append

reg support_sortition_redistribution c.majority_redistribution_real##c.treatment gender age income urbanisation i.country if education==2
outreg2 using Table1_education.doc, se dec(2) alpha(0.01, 0.05, 0.10)  ctitle("High education (Social benefit)") append

reg support_sortition_immigration c.majority_immigration_real##c.treatment gender age income urbanisation i.country if education==0
outreg2 using Table1_education.doc, se dec(2) alpha(0.01, 0.05, 0.10)  ctitle("Low education (Immigration)") append

reg support_sortition_immigration c.majority_immigration_real##c.treatment gender age income urbanisation i.country if education==1
outreg2 using Table1_education.doc, se dec(2) alpha(0.01, 0.05, 0.10)  ctitle("Mid education (Immigration)") append

reg support_sortition_immigration c.majority_immigration_real##c.treatment gender age income urbanisation i.country if education==2
outreg2 using Table1_education.doc, se dec(2) alpha(0.01, 0.05, 0.10)  ctitle("High education (Immigration)") append


